<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link href="css/reg_log.css" rel="stylesheet">
		<script src="js/jquery.js"></script>
	</head>

	<body>
		<div id="reg_div">
			<div class='title'>
				<p>注册界面</p>
			</div>
			<div class="username_div">
				<p>用户名：<input type="text" id="username_reg" name="username_reg">
					<span class="username_validate">不能为空</span>
				</p>
			</div>
			<div class="password_div">
				<p>密&nbsp码：<input type="text" id="password_reg">
					<span class="password_validate">不能为空</span>
				</p>
			</div>

			<button name="btn1" id="btn1">注册</button>
			<p id="p1"></p>
		</div>

	</body>
	<script>
		$(function() {

			$('#btn1').click(function() {
				var log_username = $("#username_reg").val();
				var log_password = $("#password_reg").val();
				console.log(log_username);
				var type = 'reg';
				$.ajax({
					type: "get",
					url: "http://127.0.0.1:8686",
					async: true,
					dataType: 'text',
					data: {
						"log_username": log_username,
						"log_password": log_password,
						"type": type
					},
					success: function(data) {
						//$("#p1").html(data);
						alert(data);
						$('#username_reg').val("");
						$('#password_reg').val("");
						location.href = 'log.html';
					}
				});
			})
		})
	</script>

</html>